//商品详情接口
import request from '@/utills/request'
export const findGoods = (id) => {
    return request('/goods', 'get', {id})
}

/**
 * 获取商品同类推荐-未传入ID为猜喜欢
 * @param {String} id - 商品ID
 * @param {Number} limit - 获取条数
 */
export const findRelGoods = (id, limit = 16) => {
    return request('/goods/relevant', 'get', { id, limit })
  }


  //获取热销榜数据
export const findGoodsHot = ({id, limit = 3, type=1}) => {
    return request('/goods/hot', 'get', { id, limit, type})
  }



  /**
 * 获取商品的评价统计信息
 * @param {String} id - 商品ID
 */
export const findCommentInfoByGoods = (id) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate`, 'get')
}
// https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate
  /**
 * 获取商品列表
 * @param {String} id - 商品ID
 */
export const findCommentListByGoods = (id,params) => {
  return request(`https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page`, 'get', params)
}
// https://mock.boxuegu.com/mock/1175/goods/${id}/evaluate/page